package j03jicheng;

public class J1 {
}
class Animal{
    private int age=2;

    int blood = 100;

    public int getAge() {
        return age;
    }
}
class Cat extends Animal{
    // 语法上允许，实际情况没有意义
    int blood = 200;

    public void readBlood(){
        //当前子类的属性
        System.out.println(blood);
        System.out.println(this.blood);
        //调父类的
        System.out.println(super.blood);//100
    }
}
class CatTest{
    public static void main(String[] args) {
        Cat c = new Cat();
//        System.out.println(c.age);
        System.out.println("c.getAge() = " + c.getAge());
        System.out.println("c.blood = " + c.blood);//200
        System.out.println("=====");
        c.readBlood();
    }
}
